Using text blocks

Text block displays text in 3D space. It uses fonts to render text and has a location and orientation in 3D space just as all the other objects do.

When you want the background of the text block objects to be transparent, you need to render the objects in the scene graph of your Kanzi application in correct order. See Rendering transparent objects.

Note that in order to properly render text you have to use a font that supports the languages you want to include in your Kanzi application.

Adding text to your application with a text block

To add text to your application with a text block:

  1. In the Project right-click the object to which you want to add the Text Block and select Create > Text Block.
  2. In the Properties in the Text property add the text you want to display. To add a new line press Shift+Enter.
  3. In the Font property select the font you want to use. See Importing fonts.
  4. Set the Text Line Height property to change the size of the displayed text.
  5. Set the Font Size property until the text is sharp.
    You can achieve the best quality when the Font Size is the same as the pixel height of the characters on the screen of the target device for your application.
  6. (Optional) Enable the Complex Script Support property if you want to:

Changing the text in a text block with native code

You can change the text shown by a text block in C application of your Kanzi application by changing the Text property with kzuObjectNodeSetStringProperty(textBlock, KZU_PROPERTY_TYPE_TEXT_LAYER__TEXT, "Enter your text here.").

See also

Importing fonts

Using text layers

Internationalization

Size of the glyph cache texture